package com.cmcc.aregister.ui.dialog;

import java.util.List;

import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ListView;

import com.cmcc.aregister.R;
import com.cmcc.aregister.cs.constant.HelpInc;
import com.cmcc.aregister.cs.model.MemberModel;
import com.cmcc.aregister.ui.adapter.ChoiceQuickMemberAdapter;

public class QuickYuyueMemberDlg extends Dialog {
	ListView list;
	List<MemberModel> members;
	Context context;
	HelpInc inc;
	public QuickYuyueMemberDlg(Context context,List<MemberModel> members,HelpInc inc) {
		super(context);
		this.members = members;
		this.context = context;
		this.inc = inc;
	}

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		setTitle(context.getString(R.string.choice_member));
		setContentView(R.layout.quick_yuyue);
		list = (ListView) findViewById(R.id.list);
		list.setOnItemClickListener(mOnItemClickListener);
		ChoiceQuickMemberAdapter adapter = new ChoiceQuickMemberAdapter(context, members);
		list.setAdapter(adapter);
	}

	OnItemClickListener mOnItemClickListener = new OnItemClickListener() {

		@Override
		public void onItemClick(AdapterView<?> adapterView, View view, int position,
				long id) {
			inc.notifyUI_member(members.get(position));
		}
	};
	
	

}
